import os
path1 = "D:/git仓库"
num1 = 0
t = "\t"
def func(path, n):
    n += 1
    for i in os.listdir(path):
        if os.path.isdir(os.path.join(path, i)):
            print(n*t, i)
            func(os.path.join(path, i), n)
        else:
            print((n+1)*t, i)


func(path1, num1)